<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class M_jabatan extends CI_Controller {

	function __construct() {
        parent::__construct();	
		$this->load->model("master/master_jabatan"); 		
	}
	
	function index()
	{
		$data['judul'] = "Master Jabatan";
		$data['list'] = $this->master_jabatan->read();
		$data['main_view']='master/jabatan/jabatan';
		$this->load->view('index',$data);
		
	}

	function save()
	{
		$dataInsert = array(
			'jabatan' => $this->input->post('jabatan')
		);
		$this->master_jabatan->save($dataInsert);
	}

	function edit()
	{
		$id_m_jabatan = $this->input->post('id_m_jabatan');
		$data['list']=$this->master_jabatan->edit($id_m_jabatan);	
		$this->load->view('master/jabatan/edit',$data);
	}
	
	function update()
	{	
		$id_m_jabatan=$this->input->post('id_m_jabatan');
		$dataUpdate=array(
			'jabatan'=>$this->input->post('jabatan')
		);
		
		$this->master_jabatan->update($id_m_jabatan,$dataUpdate);
	}
	
	function delete()
	{
		$id_m_jabatan = $this->input->post('id_m_jabatan');
		$this->master_jabatan->delete($id_m_jabatan);
	}
	
	function refresh()
	{
		$data['list'] = $this->master_jabatan->read();
		$this->load->view('master/jabatan/refresh', $data);
		
	}
	
}